<template>
  <div class="boxs-item">
    <div class="boxs-top">
      <titles :title="props.info.text" />
      <textMax :data="props.info.remarks" :maxLen="56" />
    </div>
    <t-row :gutter="20">
      <t-col :span="3" v-for="(item, index) in props.info.children" :key="index" @click="pathChild(item)">
        <div class="ornament" :style="{ background: store.styleInfo.auxiliaryColor }"></div>
        <img
          @click="pathChild(item)"
          :src="
            item.value
              ? urls + item.value + '?imageView2/1/w/240/h/320/format/webp'
              : 'http://101.34.143.36:8890/api/image/387939155165253/h_320,w_240'
          "
          alt=""
          class="img-style"
        />
        <span
          class="item-title"
          :style="{
            fontSize: store.styleInfo.mintitleSize,
            fontFamily: store.styleInfo.textFamily,
            color: store.styleInfo.fontColor,
            fontWeight: 'bold',
          }"
          >{{ item.text }}</span
        >
        <span
          class="item-text"
          :style="{
            fontSize: store.styleInfo.contentSize,
            fontFamily: store.styleInfo.textFamily,
            color: store.styleInfo.fontColor,
          }"
          >{{ item.remarks }}</span
        >
      </t-col>
    </t-row>
  </div>
</template>

<script setup lang="ts">
// @ts-nocheck
import { pathList, pathListLoop } from '../route';
import { urls } from '@/utils/request/upload';
import titles from '@/components/title/title.vue';
import buttonIcon from '@/components/title/buttonIcon.vue';
import textMax from '@/components/textMax/textMax.vue';
import { onMounted } from 'vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
import UnitImageNull from '@/components/unitImageNull/unitImageNull.vue';
const router = useRouter();
const route = useRoute();
const store = useProjectStore();
const props = defineProps({
  info: {
    type: Object,
  },
});
const pathChild = (e: any) => {
  store.setchildModel(e);
  router.push({
    name: route.meta.loopType ? pathListLoop[8] : pathList[8],
    query: {},
  });
};
</script>

<style lang="less" scoped>
@import './index.less';
.boxs-item {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.boxs-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 50px;
  width: 100%;
}
.img-style {
}
.t-col {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 586px;
}
.item-title {
  margin: 32px 0;
}
.item-title1 {
  margin-bottom: 32px;
}
.item-text {
  min-height: 112px;
  width: 100%;
  line-height: 28px;
  padding: 0 16px;
  text-overflow: -o-ellipsis-lastline;
  overflow: hidden; //溢出内容隐藏
  text-overflow: ellipsis; //文本溢出部分用省略号表示
  display: -webkit-box; //特别显示模式
  -webkit-line-clamp: 4; //行数
  line-clamp: 4;
  -webkit-box-orient: vertical; //盒子中内容竖直排列
}
.item-title {
  padding: 0 16px;
}
.ornament {
  position: absolute;
  bottom: 0;
  left: 10px;
  width: 6px;
  height: 272px;
}
</style>
